package com.nameless.controller;

import com.nameless.entity.Brand;
import com.nameless.service.BrandService;
import com.nameless.vo.BrandVo;
import com.nameless.vo.Result;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author keluoyisi
 * @program: car-parent
 * @description: 品牌的前后端接口
 * @date 2023-02-27 15:46:31
 */
@RestController
@RequestMapping("/car/brand")
public class BrandController {
    @Autowired
    private BrandService brandService;
    @PostMapping("/queryAllByParam")
    public Result selectBrandAll(@RequestBody BrandVo brandVo){
        return brandService.selectBrandAll(brandVo);
    }

    @PostMapping("/insert")
    public Result insertBrand(@RequestBody Brand brand){
        return brandService.insertBrand(brand);
    }

    @PostMapping("/update")
    public Result updateBrand(@RequestBody Brand brand){
        return brandService.updateBrand(brand);
    }

    @DeleteMapping("/deleteById")
    public Result deleteById(Integer id){
        return brandService.deleteById(id);
    }

    @GetMapping("/list")
    public Result selectList(){
        return  brandService.listBand();
    }
}
